package 软件开发原则.依赖倒转原则.before;

public class ComputerDemo {
    public static void main(String[] args) {
        //创建组件对象
        XiJieHardDisk hardDisk=new XiJieHardDisk();
        InterCpu cpu=new InterCpu();
        KingstonMemory memory=new KingstonMemory();
        //创建计算机对象
        Computer c=new Computer();
        c.setCpu(cpu);
        c.setHardDisk(hardDisk);
        c.setMemory(memory);
        //运行计算机
        c.run();
    }
}
